<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qopenglvertexarrayobject.cpp -->
  <title>Binder Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >Binder</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Binder Class</h1>
<span class="small-subtitle">Class Binder is declared in class <a href="qopenglvertexarrayobject.html">QOpenGLVertexArrayObject</a>.<br/></span>
<!-- $$$Binder-brief -->
<p>The <a href="qopenglvertexarrayobject-binder.html">QOpenGLVertexArrayObject::Binder</a> class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects. <a href="#details">More...</a></p>
<!-- @@@Binder -->
<p>This class was introduced in Qt 5.1.</p>
<ul>
<li><a href="qopenglvertexarrayobject-binder-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are <a href="../qtdoc/threads-reentrancy.html">reentrant</a>.</p>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qopenglvertexarrayobject-binder.html#Binder">Binder</a></b>(QOpenGLVertexArrayObject *<i>v</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qopenglvertexarrayobject-binder.html#dtor.Binder">~Binder</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qopenglvertexarrayobject-binder.html#rebind">rebind</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qopenglvertexarrayobject-binder.html#release">release</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$Binder-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p><a href="qopenglvertexarrayobject-binder.html">QOpenGLVertexArrayObject::Binder</a> is a simple convenience class that can be used to assist with the binding and releasing of <a href="qopenglvertexarrayobject.html">QOpenGLVertexArrayObject</a> instances. This class is to <a href="qopenglvertexarrayobject.html">QOpenGLVertexArrayObject</a> as <a href="../qtcore/qmutexlocker.html">QMutexLocker</a> is to <a href="../qtcore/qmutex.html">QMutex</a>.</p>
<p>This class implements the RAII principle which helps to ensure behavior in complex code or in the presence of exceptions.</p>
<p>The constructor of this class accepts a <a href="qopenglvertexarrayobject.html">QOpenGLVertexArrayObject</a> (VAO) as an argument and attempts to bind the VAO, calling <a href="qopenglvertexarrayobject.html#create">QOpenGLVertexArrayObject::create</a>() if necessary. The destructor of this class calls <a href="qopenglvertexarrayobject.html#release">QOpenGLVertexArrayObject::release</a>() which unbinds the VAO.</p>
<p>If needed the VAO can be temporarily unbound with the <a href="qopenglvertexarrayobject-binder.html#release">release</a>() function and bound once more with <a href="qopenglvertexarrayobject-binder.html#rebind">rebind</a>().</p>
</div>
<p><b>See also </b><a href="qopenglvertexarrayobject.html">QOpenGLVertexArrayObject</a>.</p>
<!-- @@@Binder -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Binder[overload1]$$$BinderQOpenGLVertexArrayObject* -->
<h3 class="fn" id="Binder"><a name="Binder"></a>Binder::<span class="name">Binder</span>(<span class="type"><a href="qopenglvertexarrayobject.html#QOpenGLVertexArrayObject">QOpenGLVertexArrayObject</a></span> *<i>v</i>)</h3>
<p>Creates a <a href="qopenglvertexarrayobject-binder.html">QOpenGLVertexArrayObject::Binder</a> object and binds <i>v</i> by calling <a href="qopenglvertexarrayobject.html#bind">QOpenGLVertexArrayObject::bind</a>(). If necessary it first calls <a href="qopenglvertexarrayobject.html#create">QOpenGLVertexArrayObject::create</a>().</p>
<!-- @@@Binder -->
<!-- $$$~Binder[overload1]$$$~Binder -->
<h3 class="fn" id="dtor.Binder"><a name="dtor.Binder"></a>Binder::<span class="name">~Binder</span>()</h3>
<p>Destroys the <a href="qopenglvertexarrayobject-binder.html">QOpenGLVertexArrayObject::Binder</a> and releases the associated vertex array object.</p>
<!-- @@@~Binder -->
<!-- $$$rebind[overload1]$$$rebind -->
<h3 class="fn" id="rebind"><a name="rebind"></a><span class="type">void</span> Binder::<span class="name">rebind</span>()</h3>
<p>Can be used to rebind the associated vertex array object.</p>
<p><b>See also </b><a href="qopenglvertexarrayobject-binder.html#release">release</a>().</p>
<!-- @@@rebind -->
<!-- $$$release[overload1]$$$release -->
<h3 class="fn" id="release"><a name="release"></a><span class="type">void</span> Binder::<span class="name">release</span>()</h3>
<p>Can be used to temporarily release the associated vertex array object.</p>
<p><b>See also </b><a href="qopenglvertexarrayobject-binder.html#rebind">rebind</a>().</p>
<!-- @@@release -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
